package cn.wildfire.chat.app.main;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.widget.TextView;

import com.sourcemuch.im.caiba.R;import com.sourcemuch.im.caiba.R2;

import butterknife.BindView;
import cn.wildfire.chat.kit.WfcBaseActivity;

/**
*  Create by HEKE, 2019/9/25 20:14
*  TODO 关于我们
*/
public class AboutUsActivity extends WfcBaseActivity {

    @BindView(R2.id.tv_current_version)
    TextView tvCurrentVersion;

    @Override
    protected void afterViews() {
        super.afterViews();
        tvCurrentVersion.setText(getString(R.string.current_versioncode) + ":" + packageName(this));
    }

    public String packageName(Context context) {
        PackageManager manager = context.getPackageManager();
        String name = null;
        try {
            PackageInfo info = manager.getPackageInfo(context.getPackageName(), 0);
            name = info.versionName;
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }

        return name;
    }

    @Override
    protected int contentLayout() {
        return R.layout.activity_about_us;
    }

    @Override
    protected void setTitleCenterThenSetSearchView() {
        super.setTitleCenterThenSetSearchView();
        setToolbarOrReplaceType(true, 2);
        setReplaceTitle(getString(R.string.about_us), -1);
        setSearchLayoutVisibility(false);

    }
}

